package com.cragon.aop;

import com.cragon.entity.Person;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @Description: TODO
 * @Author: ZHOUHAILONG
 * @Date: 2020年11月19日 10:22
 */
public class CustomAopBeanPostProcessor implements BeanPostProcessor {
	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean instanceof Person) {
			bean = CglibUtil.getProxy();
		}
		return bean;
	}
}
